<template>
  <view class="content">
    <!-- <image class="logo" src="/static/logo.png"></image> -->
    <view class="text-area">
      <view>
		  <!-- 顶部tab -->
        <u-tabs
            :list="list4"
            lineWidth="100"
            scrollable:true
            lineColor="#f56c6c"
            :activeStyle="{
						color: '#303133',
						fontWeight: 'bold',
						transform: 'scale(1.05)'
					}"
            :inactiveStyle="{
						color: '#606266',
						transform: 'scale(1)'
					}"
            @click="click"
            itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;"
        >
        </u-tabs>
      </view>
	  <!-- 顶部查询 -->
	   <view @click="searchss">
		<u-search :clearabled="true" style="width:150px"  :showAction="false"></u-search>
		</view>
      <!-- {{demandData[1].id}} -->
    </view>
<!-- 关注页面 -->
    <view v-if="tabIndex === 0" class="tabView">
      <text style="margin: 0rpx 0rpx 0rpx 13rpx;">关注的话题</text>
	  <!-- 关注的话题 -->
      <u-scroll-list :indicator="indicator" @right="right">
        <view v-for="(item, index) in followTopicList" :key="index">
          <image :src="item.followTopicFile" style="width: 165rpx;height: 165rpx;margin: 15rpx 20rpx 0rpx;"></image>
          <text style="margin: 0rpx 20rpx 0rpx;display: inherit;">#{{item.followTopicName}}</text>
        </view>
      </u-scroll-list>
	  <!-- 分割阴影 -->
      <u-gap height="35rpx" bgColor="#F5F5F5"></u-gap>
<!-- 关注的日记 -->
<!-- 滚动到最下面之后，触发出现更多的事件 -->
      <u-list @scrolltolower="scrolltolower">
		  <!-- list当中的一个模块 遍历关注集合对象 -->
        <u-list-item v-for="(item, index) in followUserIndexList" :key="index">
			<!-- 关注话题表头（用户头像、名称） -->
          <u-cell :border="false" :title="item.userName" size="large" :label="item.createTime" >
			  <!-- 用户头像 -->
            <u-avatar
                slot="icon"
                shape="circle"
                size="75rpx"
                :src="item.userFilePath"
                customStyle="margin: -3px 5px -3px 0"
            ></u-avatar>
          </u-cell>
		  <!-- 新发布日记<提示信息> -->
          <u-cell :border="false">
            <view slot="title">
              <text style="font-size: 25rpx;">发布了新{{item.type==1 ?'日记':'话题'}}</text>
            </view>
          </u-cell>
		  <!-- 日记(话题)简介框 -->
          <view style="background-color: #F2F2F2;margin-left: 15px; margin-right: 15px;">
            <u-cell :border="false">
				<!-- 日记(话题)的第一个图片 -->
              <u-avatar
                  slot="icon"
                  shape="square"
                  size="140rpx"
                  :src="item.contentFilePath"
                  customStyle="margin: -3px 5px -3px 0"
              ></u-avatar>
              <view slot="title" >
				  <!-- 右侧文字部分 -->
                <view style="width: 90rpx;display: inline-block;margin-right: 20rpx;">
					<!-- 类型部分 -->
                  <u-button :text="item.type==1 ?'日记':'话题'" shape="circle" size="mini" color="#333333"></u-button>
                </view>
				<!-- 话题标题 -->
                <view style="height: 35rpx; width: 350rpx;display: inline-block;">
                  <p style="width:300rpx;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;">
                    {{item.caption}}
                  </p>
                </view>
                <br>
				<!-- 话题内容 -->
                <view style="height: 90rpx; width: 500rpx;display: inline-block;">
                  <p style="width:500rpx;word-break: break-all;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;" >
                    {{item.content}}
                  </p>
                </view>
              </view>
            </u-cell>
          </view>
		<!-- 下半部分 -->
          <u-cell :border="false">
			  <!-- 话题标签 -->
            <view slot="title">
              <view style="padding: 0 3rpx;display: inline-block;margin-right: 20rpx;">
                <u-button style="color: #333333;" :text="'#'+item.labelName" shape="circle" size="mini" color="#F2F2F2"></u-button>
              </view>
            </view>
          </u-cell>
		  <!-- 浏览 评论 点赞数 -->
          <u-cell :border="false">
            <view slot="title">
				<!-- 浏览 -->
              <view style="width: 120rpx;display: inline-block;margin-right: 20rpx;">
                <u-button icon="eye" style="color: #333333;" :text="item.browse" shape="circle" size="mini" color="#FFFFFF"></u-button>
              </view>
			  <!-- 评论 -->
              <view style="width: 120rpx;display: inline-block;margin-right: 20rpx;">
                <u-button icon="chat" style="color: #333333;" :text="item.commentNum" shape="circle" size="mini" color="#FFFFFF"></u-button>
              </view>
			  <!-- 点赞 -->
              <view style="width: 120rpx;display: inline-block;margin-right: 20rpx;" @click="updateKudosByUserId(item.id,item.type,'FollowUserIndex')">
                <u-button v-if="!item.isKudosByUserId" icon="heart" style="color: #333333;" :text="item.kudosNum" shape="circle" size="mini" color="#FFFFFF"></u-button>
                <u-button v-if="item.isKudosByUserId" icon="heart-fill" style="color: #333333;" :text="item.kudosNum" shape="circle" size="mini" color="#FFFFFF"></u-button>
              </view>
            </view>
			<!-- 点赞列表 -->
            <u-avatar-group
                slot="value"
                :urls="item.kudosUserFileList"
                size="35"
                gap="0.2"
            ></u-avatar-group>
          </u-cell>
		  <!-- 底部边框(分界线) -->
          <u-gap height="15rpx" bgColor="#F5F5F5"></u-gap>
        </u-list-item>
      </u-list>

    </view>

	<!-- 话题 -->
    <view v-else-if="tabIndex === 1" class="tabView">
		<!-- 热门标题部分 -->
      <text style="margin: 0rpx 0rpx 0rpx 13rpx;">热门话题</text>
      <text style="margin: 0rpx 0rpx 0rpx 420rpx;" @click="textClick">查看更多 ></text>
	  <!-- 热门标题 横向滚动 -->
      <u-scroll-list :indicator="indicator" @right="right">
        <view v-for="(item, index) in transverseScrollTopicList" :key="index" style="background-color: #F2F2F2;margin: 15rpx 0rpx 0rpx 20rpx;">
			<!-- 话题图片 -->
          <image :src="item.contentFilePath," style="width: 145rpx;height: 145rpx;margin: 35rpx 60rpx 0rpx 60rpx;"></image>
		  <!-- 话题标题 -->
          <text style="margin: 0rpx 62rpx 0rpx;">#{{item.content}}</text><br>
		  <!-- 话题关注数量 -->
          <text style="margin: 0rpx 30rpx 0rpx;color: #999999;font-size: 24rpx;">{{item.followTopicNum}}位用户已关注</text><br>
		  <!-- 关注按钮 -->
          <view style="width: 120rpx;margin: 0 auto;"  @click="updateFollowTopicByUserId(item.id)">
            <u-button v-if="!item.isFollow" text="+关注" shape="circle" size="small" color="#333333"></u-button>
			<u-button v-if="item.isFollow" style="color: black;" text="已关注" shape="circle" size="small" color="#a1a1a1" ></u-button>
          </view>
        </view>
      </u-scroll-list>
	  <!-- 分割线 -->
      <u-gap height="15rpx" bgColor="#F5F5F5"></u-gap>
	  <!-- 推荐 最新 最热 tab 选 -->
      <u-tabs lineWidth="40" lineColor="#333333" itemStyle="width:210rpx;margin-bottom: 20rpx;" :list="list2"  @click="listTwoclick"></u-tabs>
	  <!-- 分割 -->
      <u-gap height="50rpx"></u-gap>
	  <!-- 推荐模块 -->
      <view v-if="topicTabIndex=== 0">
		  <!-- 宫格  一行有俩个-->
        <u-grid
            :border="false"
            @click="clickGrid"
            col="2"
        >
		<!-- 一个子宫格 -->
          <u-grid-item
              v-for="(baseListItem,baseListIndex) in baseList"
              :key="baseListIndex"
			  @click="clickTopic(baseListItem.releaseTopicId)"
          >
		  <!-- 话题图片 -->
            <image :src="baseListItem.contentFilePath" style="width: 300rpx;height:370rpx;"></image>
			<!-- 话题标题 -->
            <view style=" word-wrap: break-word; width: 300rpx;height: 150rpx;">
              <p	style="width:300rpx;word-break: break-all;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;" >
                {{baseListItem.content}}
              </p>
             <u-cell :label="baseListItem.userName" size="large" :border="false">
				 <!-- 话题发布者头像 -->
                <u-avatar
                    slot="icon"
                    shape="circle"
                    size="45rpx"
                    :src="baseListItem.userFilePath"
                    customStyle="margin: 0 2rpx 0 -17rpx"
                ></u-avatar>
				<!-- 话题点赞数量 -->
				<view style="width: 60rpx;" slot="right-icon"  @click="updateKudosByUserId(baseListItem.id,baseListItem.type,'TopicIndex','rand()')">
				  <u-button v-if="!baseListItem.isKudosByUserId" icon="heart" style="color: #333333;" :text="baseListItem.kudosNum" shape="circle" size="mini" color="#FFFFFF"></u-button>
				  <u-button v-if="baseListItem.isKudosByUserId" icon="heart-fill" style="color: #333333;" :text="baseListItem.kudosNum" shape="circle" size="mini" color="#FFFFFF"></u-button>
				</view>
              </u-cell>
            </view>

          </u-grid-item>
        </u-grid>
      </view>
	     <!-- 最新模块 -->
      <view v-else-if="topicTabIndex=== 1">
		  	  <!-- 宫格  一行有俩个-->
        <u-grid
            :border="false"
            @click="clickGrid"
            col="2"
        >
		<!-- 一个子宫格 -->
          <u-grid-item
              v-for="(baseListItem,baseListIndex) in baseList"
              :key="baseListIndex"
          >
		   <!-- 话题图片 -->
            <image :src="baseListItem.contentFilePath" style="width: 300rpx;height:370rpx;"></image>
			<!-- 话题标题 -->
            <view style=" word-wrap: break-word; width: 300rpx;height: 150rpx;">
              <p	style="width:300rpx;word-break: break-all;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;" >
                {{baseListItem.content}}
              </p>
			  <u-cell :label="baseListItem.userName" size="large" :border="false">
			  				 <!-- 话题发布者头像 -->
			     <u-avatar
			         slot="icon"
			         shape="circle"
			         size="45rpx"
			         :src="baseListItem.userFilePath"
			         customStyle="margin: 0 2rpx 0 -17rpx"
			     ></u-avatar>
				<!-- 话题点赞数量 -->
               <view style="width: 60rpx;" slot="right-icon"  @click="updateKudosByUserId(baseListItem.id,baseListItem.type,'TopicIndex','create_time desc')">
                 <u-button v-if="!baseListItem.isKudosByUserId" icon="heart" style="color: #333333;" :text="baseListItem.kudosNum" shape="circle" size="mini" color="#FFFFFF"></u-button>
                 <u-button v-if="baseListItem.isKudosByUserId" icon="heart-fill" style="color: #333333;" :text="baseListItem.kudosNum" shape="circle" size="mini" color="#FFFFFF"></u-button>
               </view>
              </u-cell>
            </view>

          </u-grid-item>
        </u-grid>
      </view>
	    <!-- 最热模块 -->
      <view v-else-if="topicTabIndex=== 2">
		  	  <!-- 宫格  一行有俩个-->
        <u-grid
            :border="false"

            col="2"
        >
		<!-- 一个子宫格 -->
          <u-grid-item
              v-for="(baseListItem,baseListIndex) in baseList"
              :key="baseListIndex"
          >
		   <!-- 话题图片 -->
            <image :src="baseListItem.contentFilePath" style="width: 300rpx;height:370rpx;"></image>
			<!-- 话题标题 -->
            <view style=" word-wrap: break-word; width: 300rpx;height: 150rpx;">
              <p	style="width:300rpx;word-break: break-all;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;" >
                {{baseListItem.content}}
              </p>
			  <u-cell :label="baseListItem.userName" size="large" :border="false">
			  	<!-- 话题发布者头像 -->
			     <u-avatar
			         slot="icon"
			         shape="circle"
			         size="45rpx"
			         :src="baseListItem.userFilePath"
			         customStyle="margin: 0 2rpx 0 -17rpx"
			     ></u-avatar>
				<!-- 话题点赞数量 -->
               <view style="width: 60rpx;" slot="right-icon"  @click="updateKudosByUserId(baseListItem.id,baseListItem.type,'TopicIndex','diary_record_browse')">
                 <u-button v-if="!baseListItem.isKudosByUserId" icon="heart" style="color: #333333;" :text="baseListItem.kudosNum" shape="circle" size="mini" color="#FFFFFF"></u-button>
                 <u-button v-if="baseListItem.isKudosByUserId" icon="heart-fill" style="color: #333333;" :text="baseListItem.kudosNum" shape="circle" size="mini" color="#FFFFFF"></u-button>
               </view>
              </u-cell>
            </view>

          </u-grid-item>
        </u-grid>
      </view>
    </view>
	<!-- 日记 -->
    <view v-else-if="tabIndex === 2" class="tabView">
		<!-- 日记列表 -->
      <u-list @scrolltolower="scrolltolower">
        <u-list-item v-for="(item, index) in indexList" :key="index">
			<!-- 日记标题 副标题 -->
          <u-cell :border="false" :title="`列表长度-${index + 1}`" size="large" label="描述信息">
			  <!-- 发布日记对象 -->
            <u-avatar
                slot="icon"
                shape="circle"
                size="75rpx"
                :src="item.url"
                customStyle="margin: -3px 5px -3px 0"
            ></u-avatar>
			<!-- 关注按钮 -->
            <view style="width: 120rpx;" slot="right-icon">
              <u-button text="+关注" shape="circle" size="small" color="#333333"></u-button>
            </view>
          </u-cell>
		  <!-- 日记内容 -->
          <view style="background-color: #F2F2F2;margin-left: 15px; margin-right: 15px;">
            <u-grid :border="false"  col="2">
              <u-grid-item style="border: 5rpx solid white;"
							@click="one(baseListItem.diaryId)"
                           v-for="(baseListItem,baseListIndex) in getDailyRecord"
                           :key="baseListIndex"
              >
                <u--image :showLoading="true" :src="imgUrl" width="342rpx" height="300rpx"></u--image>
                <view style="height: 60rpx;width: 100%;background:rgba(28,27,34,65%);padding-top: 20rpx;">
					<!-- 白色颜色？？？ -->
                  <text class="grid-text" style="padding-left: 130rpx; color: white;">{{baseListItem.title}}</text>
                </view>
              </u-grid-item>
            </u-grid>
          </view>
		  <!-- 具体信息 -->
          <u-cell :border="false">
            <view slot="title" style="height: 90rpx; width: 100%;display: inline-block;">
              <p style="width:100%;word-break: break-all;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;" >
                描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字
                描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字
              </p>
            </view>
          </u-cell>
			<!-- 话题标签 -->
          <u-cell :border="false">
            <view slot="title">
              <view style="width: 100rpx;display: inline-block;margin-right: 20rpx;">
                <u-button style="color: #333333;" text="#话题标签" shape="circle" size="mini" color="#F2F2F2"></u-button>
              </view>
              <view style="width: 100rpx;display: inline-block;margin-right: 20rpx;">
                <u-button style="color: #333333;" text="#话题标签" shape="circle" size="mini" color="#F2F2F2"></u-button>
              </view>
            </view>
          </u-cell>
		  <!-- 点赞 评论 浏览 -->
          <u-cell :border="false">
            <view slot="title">
              <view style="width: 120rpx;display: inline-block;margin-right: 20rpx;">
                <u-button icon="eye" style="color: #333333;" text="11111111" shape="circle" size="mini" color="#FFFFFF"></u-button>
              </view>
              <view style="width: 120rpx;display: inline-block;margin-right: 20rpx;">
                <u-button icon="chat" style="color: #333333;" text="11111111" shape="circle" size="mini" color="#FFFFFF"></u-button>
              </view>
              <view style="width: 120rpx;display: inline-block;margin-right: 20rpx;">
                <u-button icon="heart" style="color: #333333;" text="11111111" shape="circle" size="mini" color="#FFFFFF"></u-button>
                <!-- <u-button icon="heart-fill" style="color: #333333;" text="#话题标签" shape="circle" size="mini" color="#FFFFFF"></u-button> -->
              </view>
            </view>
			<!-- 点赞列表 -->
            <u-avatar-group
                slot="value"
                :urls="urlsTwo"
                size="35"
                gap="0.2"
            ></u-avatar-group>
          </u-cell>
		  <!-- 底部分界 -->
          <u-gap height="15rpx" bgColor="#F5F5F5"></u-gap>
        </u-list-item>
      </u-list>
    </view>
	<!-- 咨询 -->
    <view v-else-if="tabIndex === 3" class="tabView">
		<!-- 轮播图 -->
      <!-- <u-swiper
          :list="swiperList"
          @change="change"
          @click="click"
      ></u-swiper> -->
	  <!-- 列表 -->
      <u-list @scrolltolower="scrolltolower">
        <u-list-item v-for="(item, index) in informationList" :key="index">
			<!-- 资讯用户  -->
          <u-cell :border="false" :title="item.userName" size="large" :label="item.createTime" >
			  <!-- 资讯发布用户信息 -->
            <u-avatar
                slot="icon"
                shape="circle"
                size="75rpx"
                :src="item.userFilePath"
                customStyle="margin: -3px 5px -3px 0"
            ></u-avatar>
			<!-- 关注按钮 -->
			<!-- 关注按钮 -->
			<view style="width: 120rpx;"  v-if="!item.userId==id" @click="updateFollowUserByUserId(item.userId)" slot="right-icon">
			  <u-button v-if="!item.isFollow" text="+关注" shape="circle" size="small" color="#333333"></u-button>
			  <u-button v-if="item.isFollow" style="color: black;" text="已关注" shape="circle" size="small" color="#a1a1a1" ></u-button>
			</view>
          </u-cell>
			<!--资讯主图片 -->
          <view style="background-color: #F2F2F2;margin-left: 15px; margin-right: 15px;">
            <u--image :showLoading="true" src="http://c.svner.cn/19.jpg" width="100%" height="400rpx"></u--image>
          </view>
		  <!-- 资讯内容 -->
          <u-cell :border="false">
            <view slot="title" style="height: 90rpx; width: 100%;display: inline-block;">
              <p style="width:100%;word-break: break-all;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;" >
               {{item.caption}}
			  </p>
            </view>
          </u-cell>
		  <!-- 资讯话题标签 -->
          <u-cell :border="false" >
            <view slot="title">
              <view style="display:inline-block;margin-right: 20rpx; padding:0 3px 0 3px"  v-if="item.labelName" v-for="(item1, index) in (item.labelName||'').split(',') " :key="index" >
					<u-button style="color: #333333;" :text="'#'+item1" shape="circle" size="mini" color="#F2F2F2"></u-button>
              </view>
            </view>
          </u-cell>
		  <!-- 资讯浏览 评论 点赞 -->
          <u-cell :border="false">
            <view slot="title">
              <view style="width: 120rpx;display: inline-block;margin-right: 20rpx;">
                <u-button icon="eye" style="color: #333333;" :text="item.browse" shape="circle" size="mini" color="#FFFFFF"></u-button>
              </view>
              <view style="width: 120rpx;display: inline-block;margin-right: 20rpx;">
                <u-button icon="chat" style="color: #333333;" :text="item.commentNum" shape="circle" size="mini" color="#FFFFFF"></u-button>
              </view>
			  <view style="width: 120rpx;display: inline-block;margin-right: 20rpx;" @click="updateKudosByUserId(item.userId,4,'Information')">
			    <u-button v-if="!item.isKudosByUserId" icon="heart" style="color: #333333;" :text="item.kudosNum" shape="circle" size="mini" color="#FFFFFF"></u-button>
			    <u-button v-if="item.isKudosByUserId" icon="heart-fill" style="color: #333333;" :text="item.kudosNum" shape="circle" size="mini" color="#FFFFFF"></u-button>
			  </view>
            </view>
			<!-- 点赞列表 -->
           <u-avatar-group
                slot="value"
                :urls="item.kudosUserFileList"
                size="35"
                gap="0.2"
            ></u-avatar-group>
          </u-cell>
		  <!-- 底部分界 -->
          <u-gap height="15rpx" bgColor="#F5F5F5"></u-gap>
        </u-list-item>
      </u-list>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
		//？？？
      gridPicture: [{
        url: 'https://cdn.uviewui.com/uview/goods/1.jpg',
        title: '手术前'
      },
        {
          url: 'https://cdn.uviewui.com/uview/goods/1.jpg',
          title: '术后N天'
        }
      ],
	  //关注页面主列表
	  followUserIndexList:[],
	  //关注页面话题列表
	  followTopicList:[],
	  //资讯列表数据
	  informationList:[],
	  //话题列表数据
      baseList: [],
	  //列表长度
      indexList: [],
      urls: [
        'https://cdn.uviewui.com/uview/album/1.jpg',
        'https://cdn.uviewui.com/uview/album/2.jpg',
        'https://cdn.uviewui.com/uview/album/3.jpg',
        'https://cdn.uviewui.com/uview/album/4.jpg',
        'https://cdn.uviewui.com/uview/album/5.jpg',
        'https://cdn.uviewui.com/uview/album/6.jpg',
        'https://cdn.uviewui.com/uview/album/7.jpg',
        'https://cdn.uviewui.com/uview/album/8.jpg',
        'https://cdn.uviewui.com/uview/album/9.jpg',
        'https://cdn.uviewui.com/uview/album/10.jpg',
      ],
	  // 不显示图片指示器
      indicator: false,
      title: 'Hello',
      demandData: {},
	  // 分类列表
      list4: [{
        name: '关注'
      }, {
        name: '话题',
		// 用于进数字或状态标记提醒效果
        badge: {
          isDot: true//小圆点
        }
      }, {
        name: '日记',
      }, {
        name: '资讯'
      }],
	  //大分类列表索引
      tabIndex:0,
	  // 话题分类列表索引
      topicTabIndex:0,
	   // 最上方话题列表数据
      transverseScrollTopicList: [],
	  // 话题列表的分类名
      list2: [{
        name: '推荐'
      }, {
        name: '最新'
      }, {
        name: '最热'
      }],
	  //轮播图列表
      swiperList: [
        'https://cdn.uviewui.com/uview/swiper/swiper1.png',
        'https://cdn.uviewui.com/uview/swiper/swiper2.png',
        'https://cdn.uviewui.com/uview/swiper/swiper3.png',
      ],
	  imgUrl: 'http://c.svner.cn/19.jpg',
	  //日记列表内容
	  getDailyRecord: [],
	  id: ''
    }
  },
  // 挂载
  mounted () {
	this.id = 1
    // this.queryDemand()
	// 初始化关注页面
	this.getFollowUserIndexList()
	// 初始化关注页面
	this.getFollowTopicList()
	// 加载话题数据
	this.getTopicLabel()
	this.getDailyRecordRj()

  },
  //
  onLoad(option) {
	this.id = 1
	// 初始化关注页面
	this.getFollowUserIndexList()
	// 初始化关注页面上边话题
	this.getFollowTopicList()
	 // 读更多
    this.loadmore();
	//话题分类
    this.listTwoclick({index:0});
	//查询日记
	this.getDailyRecordRj()
  },
  methods: {
	   searchss () {
	  		  uni.navigateTo({
	  		  	  url: '../index/search'
	  		  })
	  	  },
	  //点赞or取消关注人
	  updateFollowUserByUserId(coverUserId){
	  		  uni.request({
	  				url: "http://localhost:8090/contents/updateFollowUserByUserId",
	  				method: 'GET',
	  				data:{
	  					coverUserId:coverUserId,
	  					userId:this.id,
	  				},
	  				dataType: 'json',
	  				success: (res) => {
	  					 // 更新关注状态
	  					let isFollow = res.data.object;
	  					if (isFollow) {
	  						this.getInformationList();
	  					}
	  				},
	  		  });
	  },
	  //点赞or取消话题关注
	  updateFollowTopicByUserId(topicId){
	  		  uni.request({
	  				url: "http://localhost:8090/contents/updateFollowTopicByUserId",
	  				method: 'GET',
	  				data:{
	  					topicId:topicId,
	  					userId:this.id,
	  				},
	  				dataType: 'json',
	  				success: (res) => {
	  					 // 更新关注状态
	  					let isFollow = res.data.object;
	  					if (isFollow) {
	  						this.getTopicLabel();
	  					}
	  				},
	  		  });
	  },
	  //点赞or取消点赞
	  updateKudosByUserId(kudosWholeId,kudosDictionaries,modelName,sort){
		  uni.request({
				url: "http://localhost:8090/contents/updateKudosByUserId",
				method: 'put',
				data:{
					kudosWholeId:kudosWholeId,
					kudosDictionaries:kudosDictionaries,
					kudosUserId:this.id,
				},
				dataType: 'json',
				
				success: (res) => {
					 // 更新点赞状态
					let isKudos = res.data.object;
					
					if (isKudos) {
						// 重新加载
						let methodName = 'get' + modelName + 'List';
						if(methodName=='getTopicIndexList'){
							this[methodName](sort);
						}else{
							// 调用对应的方法
							this[methodName]();
						}
					}
				},
		  });
	  },
	  //查询关注页面的主列表
	  getFollowUserIndexList(){
		  uni.request({
			url: "http://localhost:8090/contents/getFollowUserIndexList",
			method: 'get',
			data:{id:this.id},
			dataType: 'json',
			success: (res) => {
				this.followUserIndexList = res.data.object
			},
		  });
	  },
	  //查询关注页面的话题列表
	  getFollowTopicList(){
		  uni.request({
			url: "http://localhost:8090/contents/getFollowTopicList",
			method: 'get',
			data:{id:this.id},
			dataType: 'json',
			success: (res) => {
				this.followTopicList = res.data.object
			},
		  });
	  },
	  //查询资讯
	  getInformationList(){
		  
		  uni.request({
			url: "http://localhost:8090/contents/getInformationLabel",
			method: 'get',
			data:{id:this.id},
			dataType: 'json',
			success: (res) => {
				this.informationList = res.data.object
			},
		  });
	  },
	  // 点击话题(跳转笔记)
	  // 跳转日记本
	  clickTopic(diaryId){
		  //打开话题
		  //浏览量+1
		uni.navigateTo({
			  url: '../index/diaryList?id=' + diaryId
		})
	  },
	  //获取推荐话题列表
	  getTopicIndexList(sort){
		  uni.request({
			url: "http://localhost:8090/contents/getTopicIndexList",
			method: 'get',
			data:{id:this.id,
				sort:sort,},
			dataType: 'json',
			success: (res) => {
				this.baseList = res.data.object
			},
		  });
	  },
	  //获取最上方话题列表
	  getTopicLabel(){
		  uni.request({
		  	url: "http://localhost:8090/contents/getTopicLabel",
		  	method: 'get',
			data:{id:this.id},
		  	dataType: 'json',
		  	success: (res) => {
		  		this.transverseScrollTopicList = res.data.object
		  	},
		  });
	  },
	  // 查询日记
	  getDailyRecordRj(){
	  	uni.request({
	  		url: "http://localhost:8090/contents/getDailyRecordRj",                
	  		method: 'get',
	  		dataType: 'json',
	  		success: (res) => {
	  			this.getDailyRecord = res.data.object
	  		},                  
	  	});
	  },
	  // 点击话题宫格
    clickGrid(name) {
      this.$refs.uToast.success(`点击了第${name}个`)
    },
	//跳转话题分类
    listTwoclick(item) {
      console.log('item', item);
	  // 当index值为0的时候，推荐话题
      if(item.index === 0){
		// 查询推荐话题
		this.getTopicIndexList("rand()")
      }
	  // 当index值为1的时候，最新话题
      if(item.index === 1){
		  // 查询最新话题
		  this.getTopicIndexList("create_time desc")
	  }
	  // 当index值为2的时候，最热话题
      if(item.index === 2){
		  // 查询最热话题
		 this.getTopicIndexList("diary_record_browse")
	  }
	  //将值返回
      this.topicTabIndex = item.index;
    },
    // 查询话题需求
    queryDemand () {
      uni.navigateTo({
        url: '../index/diaryList'
      })
      // uni.switchTab({
      // 	url: '../hot/hot'
      // })
      // 查询组织获取组织id
      // this.$axios({
      // 	method: 'GET',
      // 	url: 'http://localhost:8085/reviews/getProvincess',
      // 	success:res=>{
      // 		console.log(res)
      // 		this.demandData = res.data.obj
      // 	}
      // })
      // uni.request({
      // 	url: "http://localhost:8090/content/getProvincess",
      // 	method: 'get',
      // 	dataType: 'json',
      // 	success: (res) => {
      // 		console.log(res.data);
      // 		this.demandData = res.data.obj
      // 		console.log(this.demandData);
      // 	},
      // });
    },
	// 点击大分类跳转
    click(item) {
      console.log('item', item);
	  // 0 关注
      if(item.index === 0){
		  //查询关注页面的话题列表
		  this.getFollowTopicList()
	  }
	  // 1 话题
      if(item.index === 1){
		  // 加载初始化内容
		  // 查询推荐话题
		  this.getTopicIndexList('rand()')
		  // 查询上方热门话题
		  this.getTopicLabel()
	  }
      // 2 笔记
	  if(item.index === 2){console.log("33333333")}
	  // 3 资讯
      if(item.index === 3){
		  //跳转到资讯
		  this.getInformationList()
	  }
	  //将值返回
      this.tabIndex = item.index;
    },
	// 横滚到头
    right() {
      console.log('横向滚动到头触发事件');
    },
	//查看更多
    textClick(){
		uni.navigateTo({
			url: '../index/topic'
		})
      console.log('话题里面的查看更多');
    },
    // 事件@scrolltolower滚动到底部触发事件
    scrolltolower() {
      this.loadmore()
    },
	// 底部增加话题数据
    loadmore() {
      for (let i = 0; i < 30; i++) {
        this.indexList.push({
          url: this.urls[uni.$u.random(0, this.urls.length - 1)]
        })
      }
    }
  }
}
</script>

<style>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo {
  height: 200rpx;
  width: 200rpx;
  margin-top: 200rpx;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 50rpx;
}
.tabView{
  width: 750rpx;
}
.text-area {
  display: flex;
  justify-content: center;
}

.title {
  font-size: 36rpx;
  color: #8f8f94;
}
.wrap {
  padding: 12px;
}

.demo-layout {
  height: 25px;
  border-radius: 4px;
}

.bg-purple {
  background: #CED7E1;
}

.bg-purple-light {
  background: #e5e9f2;
}

.bg-purple-dark {
  background: #99a9bf;
}
.swiper {
  height: 720rpx;
}

.grid-text {
  font-size: 14px;
  color: #909399;
  padding: 10rpx 0 20rpx 0rpx;
  /* #ifndef APP-PLUS */
  box-sizing: border-box;
  /* #endif */
}

</style>
